package com.zhoujun;

import com.zhoujun.entity.Order;
import com.zhoujun.entity.OrderDetail;
import com.zhoujun.utils.DataMergeUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        List<Order> orderList = new ArrayList<>();
        orderList.add(new Order("1","订单1"));
        orderList.add(new Order("2","订单2"));
        orderList.add(new Order("3","订单3"));
        orderList.add(new Order("4","订单4"));
        orderList.add(new Order("5","订单5"));
        orderList.add(new Order("6","订单6"));
        orderList.add(new Order("7","订单7"));
        orderList.add(new Order("8","订单8"));
        orderList.add(new Order("9","订单9"));
        orderList.add(new Order("10","订单10"));

        List<OrderDetail> orderDetailList = new ArrayList<>();
        orderDetailList.add(new OrderDetail("1","1","订单1->订单详情1"));
        orderDetailList.add(new OrderDetail("2","1","订单1->订单详情2"));
        orderDetailList.add(new OrderDetail("3","1","订单1->订单详情3"));
        orderDetailList.add(new OrderDetail("4","1","订单1->订单详情4"));
        orderDetailList.add(new OrderDetail("5","1","订单1->订单详情5"));
        orderDetailList.add(new OrderDetail("6","3","订单3->订单详情6"));
        orderDetailList.add(new OrderDetail("7","3","订单3->订单详情7"));
        orderDetailList.add(new OrderDetail("8","3","订单3->订单详情8"));
        orderDetailList.add(new OrderDetail("9","3","订单3->订单详情9"));
        orderDetailList.add(new OrderDetail("10","3","订单3->订单详情10"));
        orderList = DataMergeUtils.mergeDefault(orderList,Order::getOrderId,orderDetailList,OrderDetail::getOrderId);

    }
}
